<!DOCTYPE html
		PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

	<title>jQuery Hotkeys</title>

	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.js"></script>
	<script src="../hotkey.jquery.js" type="text/javascript"></script>

	<script>
		$(function() {
			var ctrl_g_1 = function() {
				$('#message')
					.append($('<p>Ctrl+G (first bind)</p>'));
			};

			$.hotkey({key:'G', ctrl: true}, ctrl_g_1);

			var ctrl_g_2 = function() {
				$('#message')
					.append($('<p>Ctrl+G (second bind)</p>'));
			};

			$.hotkey({key:'G', ctrl: true}, ctrl_g_2);

			var shift_g = function() {
				$('#message')
					.append($('<p>Shift+G</p>'));
			};

			$.hotkey({key:'G', shift: true}, shift_g);

			$.hotkey('g shift ctrl', function() {
				$('#message')
					.append($('<p>Ctrl+Shift+G</p>'));
			});

			$.hotkey('f9', function() {
				$('#message')
					.append($('<p>F9</p>'));
			});

			var f92 = function() {
				$('#message')
					.append($('<p>F9 2</p>'));
			};

			$.hotkey('f9', f92);

			$('#textmessage').hotkey('f8', function() {
				$('#textmessage')
					.val('F8');
			});

			$('#unbind')
				.bind('click', function() {
					$.unhotkey({key:'G', shift: true});
					$.unhotkey({key:'G', ctrl: true});
					$.unhotkey('f9', f92);
				});

			$('#pause')
				.bind('click', function() {
					$.pause_hotkey('g shift ctrl');
				});

			$('#unpause')
				.bind('click', function() {
					$.unpause_hotkey('g shift ctrl');
				});

			$('#pauseall')
				.bind('click', function() {
					$.pause_hotkey();
				});

			$('#unpauseall')
				.bind('click', function() {
					$.unpause_hotkey();
				});
		});
	</script>
</head>
<body>
	<h2>jQuery Hotkeys</h2>
	<p>
		<a href="javascript:;" id="unbind">Unbind Shift+G, Ctrl+G's and second F9</a>
	</p>
	<p>
		<a href="javascript:;" id="pause">Pause Ctrl+Shift+G</a>
	</p>
	<p>
		<a href="javascript:;" id="unpause">Unpause Ctrl+Shift+G</a>
	</p>
	<p>
		<a href="javascript:;" id="pauseall">Pause All</a>
	</p>
	<p>
		<a href="javascript:;" id="unpauseall">Unpause All</a>
	</p>
	<textarea id="textmessage">Press F8 while this has focus</textarea>
	<div id="message">
		<p>Press Shift+G, Ctrl+Shift+G, Ctrl+G, F9</p>
	</div>
</body>
</html>